home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / ioapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-01-22  |  2.8 KB  |  84 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /* ioapi.h -- IO base function header for compress/uncompress .zip
  8.    files using zlib + zip or unzip API
  9.  
  10.    Version 1.01, May 8th, 2004
  11.  
  12.    Copyright (C) 1998-2004 Gilles Vollant
  13. */
  14.  
  15. #include "scconfig.h"
  16.  
  17. #ifndef _ZLIBIOAPI_H
  18. #define _ZLIBIOAPI_H
  19.  
  20.  
  21. #define ZLIB_FILEFUNC_SEEK_CUR (1)
  22. #define ZLIB_FILEFUNC_SEEK_END (2)
  23. #define ZLIB_FILEFUNC_SEEK_SET (0)
  24.  
  25. #define ZLIB_FILEFUNC_MODE_READ      (1)
  26. #define ZLIB_FILEFUNC_MODE_WRITE     (2)
  27. #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
  28.  
  29. #define ZLIB_FILEFUNC_MODE_EXISTING (4)
  30. #define ZLIB_FILEFUNC_MODE_CREATE   (8)
  31.  
  32.  
  33. #ifndef ZCALLBACK
  34.  
  35. #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
  36. #define ZCALLBACK CALLBACK
  37. #else
  38. #define ZCALLBACK
  39. #endif
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
  47. typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
  48. typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
  49. typedef long   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
  50. typedef long   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
  51. typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
  52. typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
  53.  
  54. typedef struct zlib_filefunc_def_s
  55. {
  56.     open_file_func      zopen_file;
  57.     read_file_func      zread_file;
  58.     write_file_func     zwrite_file;
  59.     tell_file_func      ztell_file;
  60.     seek_file_func      zseek_file;
  61.     close_file_func     zclose_file;
  62.     testerror_file_func zerror_file;
  63.     voidpf              opaque;
  64. } zlib_filefunc_def;
  65.  
  66.  
  67.  
  68. void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
  69.  
  70. #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
  71. #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
  72. #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
  73. #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
  74. #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
  75. #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
  76.  
  77.  
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81.  
  82. #endif
  83.  
  84.